package com.mhkj.execute.adjust.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import com.mhkj.revise.plan.entity.Plan;
import com.mhkj.revise.plan.entity.PlanNode;
import com.mics.core.common.validate.annotation.NotNull;
import com.mics.core.common.validate.annotation.Validate;
import com.mics.core.system.base.entity.BaseDomain;
import com.mics.core.system.rbac.entity.Dictionary;

/**
 * 计划调整节点
 * @author wk
 * @date 2018年8月8日
 * @version 1.0
 */
@Entity
@Table(name="t_plan_node_adjust")
@Validate
public class PlanNodeAdjust extends BaseDomain{

	/**
	 * 序列号
	 */
	private static final long serialVersionUID = 6549120844181038972L;
	/**
	 * 计划
	 */
	@JoinColumn(name="plan_id")
	@ManyToOne(fetch=FetchType.LAZY)
	private Plan plan;
	

	/**
	 * 计划节点
	 */
	@JoinColumn(name="plan_node_id")
	@ManyToOne(fetch=FetchType.LAZY)
	private PlanNode planNode;
	/**
	 * 节点编号
	 */
	@Column(name="NO",length=48)
	private String NO;
	
	/**
	 * 节点名称
	 */
	@Column(name="node_name",length=48)
	@NotNull(message="节点名称不能为空！")
	private String nodeName;
	
	/**
	 * 业务板块
	 */
	@JoinColumn(name="business_id")
	@ManyToOne(fetch=FetchType.LAZY)
	private Dictionary business;

	/**
	 * 调整类型
	 */
	@JoinColumn(name="adjust_type")
	@ManyToOne(fetch=FetchType.LAZY)
	private Dictionary adjustType;
	

	@Transient
	private long adjustTypeId;
	
	/**
	 * 级别
	 */
	@Column(name="level")
	private String level;

	/**
	 * 开始时间
	 */
	@Column(name="begin_date")
	@Temporal(TemporalType.DATE)
	private Date beginDate;
	/**
	 * 结束时间
	 */
	@Column(name="end_date")
	@Temporal(TemporalType.DATE)
	private Date endDate;
	
	/**
	 * 调整工期
	 */
	@Column(name="adjust_deadline")
	private int adjustDeadline = 0;
	
	/**
	 * 申请原因
	 */
	@Column(name="remark")
	private String remark;
	
	/**
	 * 审批状态:0、未提交 1已提交、2审批中 、3、已完成4、未通过
	 */
	@Column(name="audit_state")
	private int auditState=0;
	/**
	 * 审批时间
	 */
	@Column(name="audit_date")
	@Temporal(TemporalType.DATE)
	private Date auditDate;
	/**
	 * 延迟到开始时间
	 */
	@Column(name="adjust_begin_date")
	@Temporal(TemporalType.DATE)
	private Date adjustBeginDate;
	

	/**
	 * 延迟到结束时间
	 */
	@Column(name="adjust_end_date")
	@Temporal(TemporalType.DATE)
	private Date adjustEndDate;
	

	/**
	 * 延迟到时间
	 */
	@Column(name="delay_date")
	@Temporal(TemporalType.DATE)
	private Date delayDate;
	/**
	 * 审批结果
	 */
	@Column(name="audit_result")
	private String auditResult;
	public Plan getPlan() {
		return plan;
	}
	public void setPlan(Plan plan) {
		this.plan = plan;
	}
	public String getNO() {
		return NO;
	}
	public void setNO(String nO) {
		NO = nO;
	}
	public String getNodeName() {
		return nodeName;
	}
	public void setNodeName(String nodeName) {
		this.nodeName = nodeName;
	}
	public Dictionary getBusiness() {
		return business;
	}
	public void setBusiness(Dictionary business) {
		this.business = business;
	}
	public Dictionary getAdjustType() {
		return adjustType;
	}
	public void setAdjustType(Dictionary adjustType) {
		this.adjustType = adjustType;
	}
	public String getLevel() {
		return level;
	}
	public void setLevel(String level) {
		this.level = level;
	}
	public Date getBeginDate() {
		return beginDate;
	}
	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	public int getAdjustDeadline() {
		return adjustDeadline;
	}
	public void setAdjustDeadline(int adjustDeadline) {
		this.adjustDeadline = adjustDeadline;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public int getAuditState() {
		return auditState;
	}
	public void setAuditState(int auditState) {
		this.auditState = auditState;
	}
	public Date getAuditDate() {
		return auditDate;
	}
	public void setAuditDate(Date auditDate) {
		this.auditDate = auditDate;
	}
	public Date getDelayDate() {
		return delayDate;
	}
	public void setDelayDate(Date delayDate) {
		this.delayDate = delayDate;
	}
	public String getAuditResult() {
		return auditResult;
	}
	public void setAuditResult(String auditResult) {
		this.auditResult = auditResult;
	}
	public long getAdjustTypeId() {
		return adjustTypeId;
	}
	public void setAdjustTypeId(long adjustTypeId) {
		this.adjustTypeId = adjustTypeId;
	}
	public PlanNode getPlanNode() {
		return planNode;
	}
	public void setPlanNode(PlanNode planNode) {
		this.planNode = planNode;
	}
	public Date getAdjustBeginDate() {
		return adjustBeginDate;
	}
	public void setAdjustBeginDate(Date adjustBeginDate) {
		this.adjustBeginDate = adjustBeginDate;
	}
	public Date getAdjustEndDate() {
		return adjustEndDate;
	}
	public void setAdjustEndDate(Date adjustEndDate) {
		this.adjustEndDate = adjustEndDate;
	}
}
